import http from '../..';
import { formatQuery } from '/@/libs/utils/format';

const prefix: string = '/meta/tasks';

export const getBarcodes = (taskId: string, page?: number, pageSize?: number) =>
  http.get(`${prefix}/${taskId}/barcodes?${formatQuery({ page, pageSize })}`);

export const getBarcodeDetail = (barcodeId: string) => http.get(`/meta/barcodes/${barcodeId}`);

export const getBarcodeDetailByTask = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}`);
